This repository contains solutions to my interview's problems on HackerRank, with Python 3.
Given a string, remove the vowels (consonants) from the string and print the string without vowels (consonants).
An e-commerce site tracks the purchases made each day. The product that is purchased the most one day is the featured product for the following day. If there is a tie for the product purchased most frequently, those product names are ordered alphabetically ascending and the last name in the list is chosen.
Given an array arr[]
consisting of N
integers, rearrange the array such that it satisfies the following conditions:
arr[0]
must be1
.- Difference between adjacent array elements should not exceed
1
, that is,arr[i] – arr[i-1] ≤ 1
for all1 ≤ i < N
. - The permissible operations are as follows:
- Rearrange the elements in any way.
- Reduce any element to any number ≥
1
. - The task is to find the maximum possible value that can be placed at the last index of the array.
Takes the last two letters from an input and print an output that shows just the last two letters but reversed with a space in the middle.
Given a number, return the smallest divisor, if it's prime return 1.