Company: nexthop.ai

Difficulty: medium

Problem Statement

Calibration Values You are given a list of n queries. Each query is a string made of lowercase English letters and digits, such as two1nine , 1362 or 7sixfive . Inside a query, a digit is either a digit character 0 - 9 , or a digit spelled out as one of the nine words one , two , three , four , five , six , seven , eight , nine There is no spelled form of zero: 0 only ever appears as the character 0 . The calibration value of a query is the two-digit number formed by its first digit and its last digit, reading left to right: value = 10 * (first digit) + (last digit) If a query contains exactly one digit, that digit is both the first and the last, so abc4def has value 44 . Report the sum of the calibration values of all n queries. Digits are found by position, not consumed A spelled digit is any of the nine words occurring as a substring. Two spelled digits may share letters - finding one does not remove its letters from the string. In eightwothree the digits are eight at index 0 , two

More nexthop.ai OA questionsInterview experiences