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
| # Let's bubblesort | |
| def swap(a, b): | |
| return b, a | |
| def bubblesort(numbers): | |
| length = len(numbers) | |
| swapped = True |
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 os | |
| from itertools import combinations | |
| #Given an array of distinct integers and a sum value. Find count of triplets with sum smaller than given sum value. | |
| """ | |
| Input : arr[] = {-2, 0, 1, 3} | |
| sum = 2. | |
| Output : 2 | |
| Explanation : Below are triplets with sum less than 2 |
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 location | |
| import os | |
| # function which return reverse of a string | |
| def reverse(s): | |
| return s[::-1] | |
| def isPalindrome(theString): | |
| flip = reverse(theString) |
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 location | |
| import os | |
| #Given a string S, containing special characters and all the alphabets, reverse the string without affecting the positions of the special characters. | |
| def flipString(theString): | |
| holdThese = "" | |
| listChars = list(theString) |
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
| #!/bin/bash | |
| APP_FOLDER_LOCATION=/Applications | |
| IFS="" | |
| ## Install applications via brew cask | |
| brew_install() { | |
| execute="$(brew cask install $1 2>&1)" | |
| case $execute in | |
| *Warning*|*Error*) echo "Warning while installing $1: $execute" ;; | |
| *successfully*) echo "$execute \n Installed $1." ;; |
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
| /* | |
| ** ---------------------------------------------------------------------------- | |
| ** script to create the employee table | |
| ** --------------------------------------------------------------------------*/ | |
| CREATE TABLE employee ( | |
| fName VARCHAR2(20)NOT NULL, | |
| mInit CHAR(1), | |
| lName VARCHAR2(20) NOT NULL, |
NewerOlder