Informatics2-2021/Lab11
A MathWikiből
(Változatok közti eltérés)
(→Deep Sum) |
|||
5. sor: | 5. sor: | ||
===Deep Sum=== | ===Deep Sum=== | ||
+ | Write a recursive function whose input is a list containing lists up to any depth containing positive integers. The function must return the sum of all numbers inside the list. | ||
+ | |||
+ | Example: | ||
+ | [1, 2, 3, [4, 5], [[[6], 7]]] -> 28 | ||
===Palindrome=== | ===Palindrome=== |
A lap 2021. április 27., 15:38-kori változata
Tartalomjegyzék |
Exercises
Dynamic programming
Deep Sum
Write a recursive function whose input is a list containing lists up to any depth containing positive integers. The function must return the sum of all numbers inside the list.
Example:
[1, 2, 3, [4, 5], [[[6], 7]]] -> 28
Palindrome
Factorial
Sum Digit
Sum Series
Power
Target
Finite State Machine
Parenthesis
Given a string, replace the enclosed parts of the string with a $ character. A formula is enclosed if it is surrounded by parenthesis. For example:
(xc)aa(c(b)) -> $$$$aa$$$$$$