Skip to content

Instantly share code, notes, and snippets.

View arrbxr's full-sized avatar
🎯
Focusing

Abhishek Raj Ravi arrbxr

🎯
Focusing
  • Aryabhatta Knowledge University, Bihar
  • Patna India
  • X @arrbxr
View GitHub Profile
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 June 2, 2020 08:00
Bit Manipulation Interview Questions and Practice Problems
// 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;
#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;
/* 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 05:46
Sum of Digits Using Recursion
// 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;
import numpy as np
arr = np.array([np.nan, 2, 3, 4, 5])
@arrbxr
arrbxr / index.js
Created December 24, 2018 09:17
performance check of code created by arrbxr - https://repl.it/@arrbxr/performance-check-of-code
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++) {
@arrbxr
arrbxr / main.js
Created December 23, 2018 18:10
BigO Exercise 2 created by arrbxr - https://repl.it/@arrbxr/BigO-Exercise-2
// 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)
@arrbxr
arrbxr / main.js
Created December 23, 2018 18:02
BigO Exercise 1 created by arrbxr - https://repl.it/@arrbxr/BigO-Exercise-1
// 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 September 25, 2018 18:45
GrippingNavajowhiteInverse created by arrbxr - https://repl.it/@arrbxr/GrippingNavajowhiteInverse
<!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">