# Puzzle 14) Man and his clothes

Submitted by Amit Shukla, on August 10, 2017

**Puzzle**

A man sold 38 pieces of clothes. These 38 piece of cloths were divided into shirts, trouser, and ties. If he sold at least 11 pieces of each items and he sold more shirts than trousers, and more trousers than ties. Now you have to find out the number of ties that the man must have sold.

**Important points of puzzle:**

- A man sold 38 clothes.
- These pieces are divided into shirt, trousers and ties.
- He sold at least 11 piece of each item.
- He sold more shirt then trouser.
- He sold more trouser than ties.
- Now find the number of ties he must have to sold.

**Answer**

**At least 11.**

**Reason**

According to problem there are 38 pieces sold by person. And he sold at least 11 of each item. As we know that he sold more shirts than trousers, and more trousers than ties. This means Number of shirt > Number of trousers > Number of ties. To satisfy these condition we have to sold at least 11 ties. Hence, the answer is at least 11 ties.

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions