Skip to content

This was a coding problem I was given during on HackerRank. I ran out of time during the test so I spent a few extra minutes to finish it on my own.

Notifications You must be signed in to change notification settings

Xaranta/max-min-alternating-sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

max-min-alternating-sort

This was a coding problem I was given on HackerRank for an application coding challenge. I ran out of time during the test so I spent a few extra minutes to finish it on my own.

The function was supposed to take an array of integers (in the c++ implementation they used vectors), and return an array that's elements alternated between the max and min values. so lets say we input a vector with values 2,5,-12,10,-7,-2,8,20 the function would return a vector with values 20, -12, 10, -7, 8, -2, 5, 2.

I felt pretty stupid that I didn't finish it in time since it wasn't that difficult of a problem. I spent too much time trying to look it up instead of just trying to solve it by myself.

About

This was a coding problem I was given during on HackerRank. I ran out of time during the test so I spent a few extra minutes to finish it on my own.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages