xyz_coder
BAN USER- 1of 1 vote
AnswersFind the second most repeating number in an array without using extra storage. (I had given solution using a hash table)
- xyz_coder in United States| Report Duplicate | Flag | PURGE
Amazon Intern - 0of 0 votes
AnswersImplement a stack that supports push, pop and median (the one from statistics) operation in the most efficient way
- xyz_coder in United States| Report Duplicate | Flag | PURGE
Amazon Intern - 1of 1 vote
AnswersImplement a stack that supports push, pop and mode(the one from statistics) operation in the most efficient way
- xyz_coder in United States| Report Duplicate | Flag | PURGE
Amazon Intern - 0of 0 votes
AnswersFind if a given number can be expressed in the form of p^q, where p and q are integers
- xyz_coder in United States| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm Coding - 0of 0 votes
AnswersFind all palindromes in a given string. Single letters are also considered as palindromes.
- xyz_coder in United States| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm Coding - 1of 1 vote
AnswersGiven a number A, find the smallest number which has only 1s and 0s as its digits which divisible by the number A. For example: if the given number A is 4, the smallest number with 1s and 0s is which is divisible by 4 is 100.
- xyz_coder in United States| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm Arrays Coding - 4of 4 votes
AnswersGiven a string S, you are allowed to convert it to a palindrome by adding 0 or more characters in front of it.
- xyz_coder in United States
Find the length of the shortest palindrome that you can create from S by applying the above transformation.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer - 0of 0 votes
Answerst's laundry day, and, as usual, you've been putting this off for quite some time. Also, unfortunately, you lacked the foresight to actually ensure all your dirty laundry stayed in your hamper whilst it accumulated (what? we can't ALL be underwear basketball pros!).
- xyz_coder in United States
Begrudgingly, you've gathered up all the clothing you could find and sent them through the wash. Now you have a disheveled pile of clean, albiet disorganized, accoutrements. You come to the realization that you probably lost some items in the fray, so now it's time to fold and figure out what's gone missing!
To get a good idea of the state of your wardrobe, count up the number of distinct shirts, pants, and underwear you have as you go through the laundry. Also pair up your socks, noting the number of pairs of each kind of sock and if there are any lonely souls (single (and ready to mingle) socks).
Input Specifications
Each article of clothing will have its own separate line. You have a penchant for hoarding, so there is no guarantee as to the number of pieces, but you can assure yourself that each article can be easily categorized by description (name).
Articles of clothing will be fed in as line-delimited list. See below for examples.
Output Specifications
Output should be an alphabetically (case-insensitive) sorted, line-delimited list of the articles of clothing along with their count. Each field (count, category) should be separated by a pipe (|). If you come across a sock without a soulmate, the count should be designated by a 0 (zero). Socks that are in pairs should be on separate lines from the socks of the same category without pairs, and should come before the pairless sock. See below for examples.
Sample Input/Output
INPUT
white shirt
polka dot sock
red sock
superhero shirt
torn jeans
polka dot sock
white shirt
polka dot sock
OUTPUT
1|polka dot sock
0|polka dot sock
0|red sock
1|superhero shirt
1|torn jeans
2|white shirt
EXPLANATION
As described above in the input and output specifications.| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Algorithm
- 0 Answers Data Structure for file directory
There was a question one of my friends was asked in an interview.
- xyz_coder November 21, 2014
Write a code in C which which can store all the files and folders. Each folder can contain multiple files and folders as well. (Assume names of folders and directories will be given, no need of using system functions). Focus here is on using an efficient Data structure.| Flag | PURGE
Hi I tested your code as well. It works only for the input case I have given. It does not pass all test cases.
- xyz_coder November 15, 2014