Company: Ibm_1aug

Difficulty: medium

Problem Statement

Count 'hello' Copies Problem Description Noor runs a small sign shop that assembles custom banners from individual letter tiles. A customer walks in with a bag holding a jumble of random lowercase letters (a-z) and asks for as many copies of the word "hello" as can be spelled out. Noor needs to work out the number of complete "hello"s buildable from that bag of tiles, and with a stack of orders waiting, she'd like a quick way to get the answer. Input Format A single line containing a string S, consisting only of lowercase English letters (a-z). Output Format An integer representing the maximum number of times the word "hello" can be formed using the characters from the given string. Examples Example 1: Input: helworld Output: 1 Explanation: From the string "helworld", one complete "hello" can be formed using 'h', 'e', 'l', 'l', 'o'. Example 2: Input: hbebhgtlellooffgf Output: 2 Explanation: From the string "hbebhgtlellooffgf", two complete "hello"s can be formed. Constraints 1 <= |S

More Ibm_1aug OA questionsInterview experiences