+ 45

[M💙 Challenge] Finger Counting ✋🖖✋

Monday Blue 💙 Challenge Series #13 Let's do some counting this week! This time we will need to determine which finger was last counted using Sololand's arithmetic. Assume that we will use both our hands with 5 fingers, here's how we do the counting start with the left-hand:- ✋ Left Hand Thumb: 1 Index: 2 Middle: 3 Ring: 4 Baby: 5 ✋ Right Hand Thumb: 6 Index: 7 Middle: 8 Ring: 9 Baby: 10 Once we reached to the end, we will continue to count backwards and here's the label for each of the fingers count up to 31:- ✋ Left Hand Thumb: 1, 19 Index: 2, 18, 20 Middle: 3, 17, 21 Ring: 4, 16, 22 Baby: 5, 15, 23 ✋ Right Hand Thumb: 6, 14, 24 Index: 7, 13, 25, 31 Middle: 8, 12, 26, 30 Ring: 9, 11, 27, 29 Baby: 10, 28 💼 TASK Write a program to accept an integer and determine which finger was last counted with the given number. 🔧 TEST CASE 10 ➡ "Baby Finger (Right)" 22 ➡ "Ring Finger (Left)" 25 ➡ "Index Finger (Right)" 42 ➡ "Thumb (Right)" 101 ➡ "Ring Finger (Right)" 1001 ➡ "Ring Finger (Right)" 25122017 ➡ "Ring Finger (Right)" 31122017 ➡ "Middle Finger (Left)" ❤ BONUS Clear-cut and optimized approach is encouraged. 👍 SPECIAL MENTION Straightforward ver. https://code.sololearn.com/cTEi6zPl6NDA/?ref=app Visualization ver. https://code.sololearn.com/WV5D4LC34BRb/?ref=app Happy Coding!!! 😁💻

18th Dec 2017, 1:08 PM
Zephyr Koo
Zephyr Koo - avatar
54 ответов
11th Dec 2017, 7:24 PM
Hiroki Masuda
Hiroki Masuda - avatar
+ 24
My try : https://code.sololearn.com/cI2iO789G5WY/?ref=app Thanks for the challenge.
11th Dec 2017, 4:38 AM
Swapnil Srivastava
Swapnil Srivastava - avatar
11th Dec 2017, 5:34 AM
qwerty
qwerty - avatar
+ 21
https://code.sololearn.com/cVg5dUTG2C2X/?ref=app
11th Dec 2017, 7:24 AM
LukArToDo
LukArToDo - avatar
+ 21
I already did this but this time I'm going to use assembly because of how easy this challenge is. https://code.sololearn.com/c0DaHRV9x1nZ/?ref=app
14th Dec 2017, 11:56 AM
qwerty
qwerty - avatar
+ 18
Waiting for the next challenge.
18th Dec 2017, 8:01 AM
qwerty
qwerty - avatar
+ 17
@blackcat1111 Thank you! Again, this was inspired from the riddle I've solved when I was small and I hope you all have fun solving it! Yes you guess is correctly as it's trivial if you learnt the concept before. However I believe the easier the problem, the more challenging to write a clean code which distinct from others. Enjoy! 😉
11th Dec 2017, 4:36 AM
Zephyr Koo
Zephyr Koo - avatar
+ 17
@blackcat1111 Wow that was real fast! Thank you for your submission! XD
11th Dec 2017, 5:34 AM
Zephyr Koo
Zephyr Koo - avatar
+ 16
Sorry it took so long! My code is pretty long and very inconvenient though. 😅 https://code.sololearn.com/cEADoKAkK77s/?ref=app
11th Dec 2017, 5:02 AM
blackcat1111
blackcat1111 - avatar
+ 16
https://code.sololearn.com/cUx6K6ageo4G/?ref=app
11th Dec 2017, 8:24 AM
Käzî Mrîdùl Høssäîn
Käzî Mrîdùl Høssäîn - avatar
+ 16
I'm really late 😂😂. But I did a good work here, thou 😉 https://code.sololearn.com/cLl91n16DRKk/?ref=app
31st Dec 2017, 2:37 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 15
https://code.sololearn.com/cl8xT0ML77D4/?ref=app
11th Dec 2017, 7:37 AM
Aayush Bhansali
Aayush Bhansali - avatar
+ 14
Thanks 😁😂
1st Jan 2018, 2:26 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 12
My try, I love Zephyr's Challenges https://code.sololearn.com/cSmDA7H3T7pX/?ref=app
11th Dec 2017, 10:13 AM
David Akhihiero
David Akhihiero - avatar
+ 12
Thanks everyone for your participation! Apologize for late review today as I'm kinda occupied and I seems to facing drought for my idea faucet. Again, we got submissions featured in SPECIAL MENTION this time and I hope you really enjoy the challenge. Let's move on to the next challenge! ❤ https://www.sololearn.com/Discuss/937081/?ref=app
18th Dec 2017, 2:33 PM
Zephyr Koo
Zephyr Koo - avatar
+ 11
@Ace Not really, at least it's easier to read compared to traditional if-else with proper indentation. 😂
11th Dec 2017, 2:32 PM
Zephyr Koo
Zephyr Koo - avatar
12th Dec 2017, 4:24 PM
AZTECCO
AZTECCO - avatar
+ 11
Here it is. My visual solution. Though I can't find a complete sprite sheet with closed fist.😥 https://code.sololearn.com/WV5D4LC34BRb/?ref=app
14th Dec 2017, 12:18 AM
Jonathan Pizarra (JS Challenger)
Jonathan Pizarra (JS Challenger) - avatar
+ 10
Wow. How do you come up with such creative ideas? Anyways, seems easy enough (subject to change) so I'll give it a try. 😉
11th Dec 2017, 4:28 AM
blackcat1111
blackcat1111 - avatar