We have a list containing 25 numbers, that we need to sort and figure out the greatest three numbers. However, the catch is that you can only sort 5 numbers in a single operation. So, basically imagine a function that will sort your numbers but can only take in 5 at a time. Using this function we need to be able to sort the 25 numbers to get top 3. Also, make a note of how many times the sorting function is called.
This file contains 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
package main | |
import ( | |
"encoding/csv" | |
"encoding/json" | |
"fmt" | |
"io" | |
"net/http" | |
"os" | |
"time" |
This file contains 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 | |
if [ -z ${AWS_PROFILE} ] | |
then | |
echo "AWS_PROFILE is not set" | |
exit | |
fi | |
if [ -z ${AWS_REGION} ] | |
then |
This file contains 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 | |
if [ -z "${DELETE_PATTERN}" ] | |
then | |
echo "please set DELETE_PATTERN environment variable with pattern to delete" | |
exit | |
fi | |
if [ -z "${AWS_PROFILE}" ] | |
then |
press Win(key) + R shortcut
This file contains 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
% Created 2019-01-24 Thu 13:31 | |
% Intended LaTeX compiler: pdflatex | |
\documentclass[11pt]{article} | |
\usepackage[utf8]{inputenc} | |
\usepackage[T1]{fontenc} | |
\usepackage{graphicx} | |
\usepackage{grffile} | |
\usepackage{longtable} | |
\usepackage{wrapfig} | |
\usepackage{rotating} |
This file contains 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
package main | |
import ( | |
"fmt" | |
) | |
func factorial(n uint) uint { | |
if n < 0 || n > 100 { | |
This file contains 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
#!/usr/bin/env ruby | |
# List all keys stored in memcache. | |
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place. | |
require 'net/telnet' | |
require 'csv' | |
headings = %w(id expires bytes key) | |
rows = [] |
This file contains 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>Drawing Competition for Primary School</title> | |
<!-- 2017-03-03 Fri 11:29 --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="generator" content="Org-mode"> | |
<meta name="author" content="Balman Rawat"> |
NewerOlder