This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Cancel all the LinkedIn sent invitations | |
| from selenium import webdriver | |
| from selenium.common.exceptions import NoSuchElementException | |
| from selenium.webdriver.common.keys import Keys | |
| import time | |
| # For entering password from console | |
| import getpass | |
| # For quitting app if login fails. | |
| import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://www.hackerrank.com/challenges/validating-uid/problem | |
| def uid_validator(uid): | |
| characters = list(uid) | |
| if len(uid) != 10: | |
| # print("Length property missed.") | |
| return False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RECEIPENT_EMAIL = '' | |
| SENDER_EMAIL = '' | |
| PASSWORD = '' |
Let’s observe a few facts in case of minimum number:
- The digits can’t repeat hence there can be 9 digits at most in output.
- To form a minimum number , at every index of the output, we are interested in the minimum number which can be placed at that index.
The idea is to iterate over the entire input array , keeping track of the minimum number (1-9) which can be placed at that position of the output.
The tricky part of course occurs when ‘D’ is encountered at index other than 0. In such a case we have to track the nearest ‘I’ to the left of ‘D’ and increment each number in the output vector by 1 in between ‘I’ and ‘D’.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Java program to find a triplet | |
| class FindTriplet { | |
| // returns true if there is triplet with sum equal | |
| // to 'sum' present in A[]. Also, prints the triplet | |
| boolean find3Numbers(int A[], int arr_size, int sum) | |
| { | |
| int l, r; | |
| /* Sort the elements */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| class ReverseArray { | |
| public static void reverse(int array[], int start, int end) { | |
| if(start >= end) { | |
| return; | |
| } | |
| int temp = array[end]; | |
| array[end] = array[start]; |
You are given two integers n and k. Find the greatest integer x, such that, x^k <= n.
Input Format:
First line contains number of test cases, T. Next T lines contains integers, n and k.
Constraints:
1<=T<=10 1<=N<=10^15

