Skip to content

Instantly share code, notes, and snippets.

View theArjun's full-sized avatar

Arjun Adhikari theArjun

View GitHub Profile
@theArjun
theArjun / OUTPUT.md
Last active May 7, 2019 09:06
Selection Sort in C++

OUTPUT

@theArjun
theArjun / linkedin_wihdraw_requests.py
Last active November 7, 2025 21:17
Cancel LinkedIn sent Connection Requests
# 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
@theArjun
theArjun / ABOUT.md
Last active April 27, 2019 17:52
Mock Data for Name, Address and Salary

✍ Arjun Adhikari, April 26, 2019

Question

A data tile "emp.txt" contains name, address and salary of 30 employees. Write a program to display only those records who are from "Kathmandu".

Output

In Java

@theArjun
theArjun / ABOUT.md
Last active April 25, 2019 15:36
Max Split in Python

Output

Output

@theArjun
theArjun / validating_uid.py
Created April 24, 2019 15:02
Validating UID - Hackerrank
# 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
@theArjun
theArjun / config.py
Created April 13, 2019 18:49
Send Email from Python using smtplib
RECEIPENT_EMAIL = ''
SENDER_EMAIL = ''
PASSWORD = ''
@theArjun
theArjun / ABOUT.md
Last active April 5, 2019 14:13
Generate Minimum Number from Given Pattern

Generate Minimum Number from Given Pattern

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’.

@theArjun
theArjun / FindTriplets.java
Created March 31, 2019 10:00
Additive Triplets In Array
// 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 */
@theArjun
theArjun / ReverseArray.java
Last active March 31, 2019 08:29
Reverse Array By Recursion
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];
@theArjun
theArjun / ABOUT.md
Created March 22, 2019 11:39
Hackerblocks Solution

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