Since CrowdStrike sent out a Hackerrank without having an intent to hire interns this late I decided to post the questions. Hopefully this helps the next intern class!
LinkedLists are not suitable to implement
Coding:
Given a List represented as
Input: Louis IX, Louis VIII
Output: [Louis VIII, Louis IX]
sort by name first then roman numeral
Given a linkedList where each node has a 0 or 1 convert it to long decimal value.
e.g. 0 -> 1 -> 0 -> 0 -> 1 -> 1 -> /
return 19
Solt Machine 2.0
Given: n = 4
spins
[7, 1, 2]
[2, 4, 6]
[3 ,6 ,5]
[3, 1, 2]
We remove the largest value in each row, and add the max to the resutl.
E.g. Take 7, remove from each row 7, 6, 6, 3
now we have
[1, 2]
[2, 4,]
[3, 5]
[1, 2]
take 5, remove from each row 2, 4, 5, 2
[1]
[2]
[3]
[1]
take 3 remove 1, 2, 5, 1
answer is 7 + 5 + 3 = 15, return 15
Example 2:
1 3 7
1 1 5
3 6 4
1 1 5
7 2 4
take 7 and remove max from each row
1 3
1 1
3 4
1 1
2 4
take 4 and remove max from each row
1
1
3
1
2
take 3 and remove max from each row
7 + 3 + 4 = 14, return 14
Thoughts? I used a list of maxPQs.