6 kyu

Find the discounted prices

215 of 549GiacomoSorbi

Description:

Your friend Cody has to sell a lot of jam, so he applied a good 25% discount to all his merchandise.

Trouble is that he mixed all the prices (initial and discounted), so now he needs your cool coding skills to filter out only the discounted prices.

For example, consider this inputs:

"15 20 60 75 80 100"
"9 9 12 12 12 15 16 20"

They should output:

"15 60 75"
"9 9 12 15"

Every input will always have all the prices in pairs (initial and discounted) sorted from smaller to bigger.

You might have noticed that the second sample input can be tricky already; also, try to have an eye for performances, as huge inputs could be tested too.

Final Note: kata blatantly taken from this problem (and still not getting why they created a separated Code Jam for ladies, as I find it rather discriminating...).

Arrays
Lists
Algorithms

Similar Kata:

Stats:

CreatedMar 24, 2016
PublishedMar 24, 2016
Warriors Trained1460
Total Skips50
Total Code Submissions2677
Total Times Completed549
Python Completions280
JavaScript Completions215
Ruby Completions57
Haskell Completions32
Go Completions3
Total Stars25
% of votes with a positive feedback rating91% of 149
Total "Very Satisfied" Votes128
Total "Somewhat Satisfied" Votes15
Total "Not Satisfied" Votes6
Total Rank Assessments19
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • GiacomoSorbi Avatar
  • bkaes Avatar
  • DealPete Avatar
  • damjan Avatar
  • Voile Avatar
  • FArekkusu Avatar
  • ossiferclyde Avatar
  • akar-0 Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad