Count all pairs of numbers from a list where the ending digit of the ith number equals the starting digit of the jth number. Example [122, 21, 21, 23] should have 5 pairs (122, 21), (122, 21), (122, 23), (21, 122), (21, 122) - Approached it by taking least significant (%10) digit of the ith number and most significant digit (using log base 10 to compute successive division number by 10) of the jth number, but here the interviewer mentioned that log 122 is 22 (not sure how)
AnswerBot
3mo
Count pairs of numbers where ending digit of ith number equals starting digit of jth number.
Iterate through each pair of numbers in the list
Check if the ending digit of the ith number equals the start...read more
Help your peers!
Add answer anonymously...
Top SAP Senior Data Scientist interview questions & answers
Popular interview questions of Senior Data Scientist
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app