DEV Community

King coder
King coder

Posted on

Day 44 of DSA Problem Solving

Welcome to Day 44 of my Data Structures and Algorithms (DSA) problem-solving journey! Below are some simple JavaScript solutions to basic problems.

Q1: Sum of Two Integers

let a = 5;
let b = 10;
let sum = a + b;
console.log(`The sum of ${a} and ${b} is: ${sum}`);
Enter fullscreen mode Exit fullscreen mode

Q2: Convert Minutes into Seconds

Approach:

To convert minutes into seconds, we use the fact that 1 minute equals 60 seconds.

By multiplying the number of minutes by 60, we get the equivalent number of seconds.

This method is simple and efficient for basic time conversions.

let minutes = 5;
let seconds = minutes * 60;
console.log(`${minutes} minutes is equal to ${seconds} seconds.`);
Enter fullscreen mode Exit fullscreen mode

Top comments (0)