(919) 964-9842
(919) 964-9842

Currently browsing Development

Hackerrank in PHP: Sorting - Bubble Sort

Posted on by Christina Gleason
Categories: Development

The beauty with this problem is that they give you the bubble sort algorithm already. You just need to translate it into your language of choice (in this case, PHP), add in a counting mechanism, and find the first and last element of the array once all the swapping is done. For this problem, we […]

Read More »

Hackerrank in PHP: Alternating Characters

Posted on by Christina Gleason
Categories: Development

This one was pretty straightforward but I got messed up on not actually removing the duplicate. So I had an unset() call in there to remove the duplicate and it was throwing off my numbers. In this case, they just want you to count the duplicates, not remove them. Let's find the duplicate characters in […]

Read More »

Hackerrank in PHP: Repeated String

Posted on by Christina Gleason
Categories: Development

I saw this solution with several for loops and just, way too complicated. I think it just comes down to looping through the last bit because you need to determine how many of the remaining letters are letter As. Anyways, this is my solution in PHP for the Repeated String problem on Hackerrank. You are […]

Read More »

Hackerrank in PHP: Jumping on Clouds

Posted on by Christina Gleason
Categories: Development

This one from Hackerrank stumped me for a moment and then I cleared everything I was doing and got it in one try. I think my problem with these is I overthink them too much. Anyways, Emma is jumping on sequentially numbered clouds. She cannot jump on clouds that equal 1 (this threw me off). […]

Read More »