Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Loser Boy arrbxr

🎯
Focusing
View GitHub Profile
View sortLastName.py
name = ["abhishek", "abhishek raj", "kumar soun", "raj kumar" "pagla ravi", "simpee singh" ]
name.sort(key = lambda nm: nm.sort(" ")[-1])
print name
@arrbxr
arrbxr / Q1. Check even or odd.cpp
Last active Jun 2, 2020
Bit Manipulation Interview Questions and Practice Problems
View Q1. Check even or odd.cpp
// Check if a given integer is even or odd.
/*
n = 5 = 101(binary) | n = 6 = 0110
1 = 001(binary) | 1 = 0001
------------ | --------
& - 001 == 1 (true) | &- 0000 == 0 (false)
*/
#include<iostream>
using namespace std;
View classTemplate.cpp
#include<iostream>
using namespace std;
template <class T>
class myvalues {
T myval1, myval2; // two value of type T
public:
myvalues(T arg1, T arg2){
myval1 = arg1;
myval2 = arg2;
View Series of Numbers.cpp
/* By using a two-dimensional array, write C++ program to display the exact table of numbers that is shown below:
##################
# 1 2 3 4 5 #
# 6 7 8 9 10 #
# 11 12 13 14 15 #
# 16 17 18 19 20 #
# 21 33 23 24 25 #
##################
*/
@arrbxr
arrbxr / DigitSum.cpp
Created May 8, 2020
Sum of Digits Using Recursion
View DigitSum.cpp
// Sum of Digits Using Recursion
#include <iostream>
using namespace std;
int DigitSum(int);
int main() {
int num, sum;
cout<<"Enter Number to add digit: ";
cin>>num;
View npArray.md
import numpy as np
arr = np.array([np.nan, 2, 3, 4, 5])
@arrbxr
arrbxr / index.js
Created Dec 24, 2018
performance check of code created by arrbxr - https://repl.it/@arrbxr/performance-check-of-code
View index.js
const {performance} = require('perf_hooks');
const nemo = ['nemo'];
const everyone = ['abhishek', 'pagla', 'ravi', 'raj', 'sita', 'gita', 'ram'];
const large = new Array(100000).fill('nemo');
function findNemo(array) {
let t0 = performance.now();
for (let i = 0; i < array.length; i++) {
View main.js
// What is the Big O of the below function? (Hint, you may want to go line by line)
function anotherFunChallenge(input) {
let a = 5; // O(1)
let b = 10;// O(1)
let c = 50;// O(1)
for (let i = 0; i < input; i++) {
let x = i + 1; // O(n)
let y = i + 2; // O(n)
let z = i + 3; // O(n)
View main.js
// What is the Big O of the below function? (Hint, you may want to go line by line)
function funChallenge(input) {
let a = 10; // O(1)
a = 50 + 3; // O(1)
for (let i = 0; i < input.length; i++) { // O(n) here n -> number of input
anotherFunction(); // O(n)
let stranger = true; // O(n)
a++; // O(n)
}
@arrbxr
arrbxr / index.html
Created Sep 25, 2018
GrippingNavajowhiteInverse created by arrbxr - https://repl.it/@arrbxr/GrippingNavajowhiteInverse
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:100,300,400,600" rel="stylesheet" type="text/css">
<link href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css">
<link type="text/css" rel="stylesheet" href="syle.css">
You can’t perform that action at this time.