Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
arr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
target: 41
pairs: [(12, 29), (13, 28), (14, 27), (15, 26), (16, 25), (17, 24), (18, 23), (19, 22), (20, 21), (21, 20), (22, 19), (23, 18), (24, 17), (25, 16), (26, 15), (27, 14), (28, 13), (29, 12)]
as ints: [1229, 1328, 1427, 1526, 1625, 1724, 1823, 1922, 2021, 2120, 2219, 2318, 2417, 2516, 2615, 2714, 2813, 2912]
sum: 37269
sum % 50: 19
result: False
Explained by ChristianEcooper
this goes inside the program
Kata has been checked ans edited by the geeks. It is all fine now you can try it
arr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
target: 41
pairs: [(12, 29), (13, 28), (14, 27), (15, 26), (16, 25), (17, 24), (18, 23), (19, 22), (20, 21), (21, 20), (22, 19), (23, 18), (24, 17), (25, 16), (26, 15), (27, 14), (28, 13), (29, 12)]
as ints: [1229, 1328, 1427, 1526, 1625, 1724, 1823, 1922, 2021, 2120, 2219, 2318, 2417, 2516, 2615, 2714, 2813, 2912]
sum: 37269
sum % 50: 19
result: False
Explained by ChristianEcooper
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
22 is not possible since 2 is a digit that is repeated. But 13 and 31 are valid numbers, because there is no digit repeated in 13 (1 and 3 is unique) and 31( 3 and 1 is unique).
Good kata but it is in the level of 7Kyu
Great Kata.. classic Dyanamic programming helps to get the program done!! I think other than dyanamic programming no other algorithm will help..