Skip to main content

Command Palette

Search for a command to run...

Top 2 Lowe's Coding Interview Questions from 2025

Updated
2 min read

Introduction

In this blog post, we'll share the most commonly asked coding interview questions at Lowe's. If you don't have months to study for your interviews, you can use AI tools like Chatmagic to generate solutions quickly and efficiently - helping you pass the interviews and get the job offer!

Problem #1: Find the Original Typed String I

Alice is attempting to type a specific string on her computer. However, she tends to be clumsy and may press a key for too long, resulting in a character being typed multiple times. Although Alice tried to focus on her typing, she is aware that she may still have done this at most once. You are given a string word, which represents the final output displayed on Alice's screen. Return the total number of possible original strings that Alice might have intended to type. Example 1: Input: word = "abbcccc" Output: 5 Explanation: The possible strings are: "abbcccc", "abbccc", "abbcc", "abbc", and "abcccc". Example 2: Input: word = "abcd" Output: 1 Explanation: The only possible string is "abcd". Example 3: Input: word = "aaaa" Output: 4 Constraints: 1 <= word.length <= 100 word consists only of lowercase English letters.

Topics: String

Problem #2: Minimum Operations to Make Array Values Equal to K

You are given an integer array nums and an integer k. An integer h is called valid if all values in the array that are strictly greater than h are identical. For example, if nums = [10, 8, 10, 8], a valid integer is h = 9 because all nums[i] > 9 are equal to 10, but 5 is not a valid integer. You are allowed to perform the following operation on nums: Select an integer h that is valid for the current values in nums. For each index i where nums[i] > h, set nums[i] to h. Return the minimum number of operations required to make every element in nums equal to k. If it is impossible to make all elements equal to k, return -1. Example 1: Input: nums = [5,2,5,4,5], k = 2 Output: 2 Explanation: The operations can be performed in order using valid integers 4 and then 2. Example 2: Input: nums = [2,1,2], k = 2 Output: -1 Explanation: It is impossible to make all the values equal to 2. Example 3: Input: nums = [9,7,5,3], k = 1 Output: 4 Explanation: The operations can be performed using valid integers in the order 7, 5, 3, and 1. Constraints: 1 <= nums.length <= 100 1 <= nums[i] <= 100 1 <= k <= 100

Topics: Array, Hash Table

More from this blog

C

Chatmagic blog

2894 posts