Search⌘ K
AI Features

Feature #1: Add Likes

Explore how to create a module that sums two string-represented numbers without converting them to integers. Understand digit-by-digit addition to handle inputs from text files, focusing on algorithms applicable to real coding interviews. Gain insight into time and space complexity, and consider how to adapt this method for binary numbers.

Description

For the first feature of the Twitter application, we are creating an API that calculates the total number of likes on a person’s Tweets. For this purpose, your team member has already extracted the data and stored it in a simple text file for you. You have to create a module that takes two numbers at a time and returns the sum of the numbers. The inputs were extracted from a text file, so they are in the form of strings. The limitation of the API is that we want all of the values to remain strings. We cannot even convert the string to numbers temporarily.

For example, let’s say you are given the strings "1545" ...