Q1. CoderPad-friendly DSA problem on Sum of Digits with multiple variations and solutions for example do the sum until you get a single digit number for any given number Q2. SQL Join like -- List the Second Highest Salary By Department Listing the second-highest salary by the department is a practical example that showcases the use of advanced SQL techniques. PostgreSQL is a powerful open-source relational database that offers below functions to List the Second Highest Salary By Department are as follows:
Implement Q1 as a Python function. Given an integer, repeatedly sum its decimal digits until the result is a single digit.
def sum_digits_until_single(number): accepts an integer and returns an integer from 0 through 9. Negative inputs are processed using their absolute value.
def sum_digits_until_single(number):