Skip to content

Instantly share code, notes, and snippets.

View arpanpreneur's full-sized avatar

Arpan Mukherjee arpanpreneur

View GitHub Profile
@arpanpreneur
arpanpreneur / main.dart
Created December 11, 2020 07:18
Flutter App to simulate data loading
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
// Best Case is O(1) worst case in O(n)
// where n is the no of nodes in the tree represented by the object
function deepCheck(obj1, obj2) {
// If they are equal Primitives (think as leaf nodes) or they refer to same memory
if (obj1 === obj2) return true;
// If Both are NaN
if (obj1 === NaN && obj2 === NaN) return true;
@arpanpreneur
arpanpreneur / CustomLinkedList.java
Last active March 27, 2020 12:37
Custom generic Linked List implementation in Java for Interview Problems.
/*
* Custom generic Linked List implementation in Java.
* This class is for working with Linked List related interview problems.
*
* It is intended to be extended with a Type paramater as follows:
*
* class PracticeSoln extends CustomLinkedList<Integer> {
*
* protected void solution() {
* Node temp = this.head;
import java.util.*;
class Bowl {
static int getModifiedBowl(int[] marbles) {
for (int i = marbles.length - 1; i >= 0; i--) {
if (marbles[i] < 9) {
// This one is not required here, but in online compiler it might ask to modify the original array
// sent to the funtion
import java.util.*;
class Intern {
static String getStringValue(int n) {
switch (n) {
case 1: return "First";
case 2: return "Second";
case 3: return "Third";
case 4: return "Fourth";
case 5: return "Fifth";
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int getRandomNumber(int lower, int upper) {
return (rand() % (upper - lower + 1)) + lower;
}
int main() {
/**
* You can copy, modify, distribute and perform the work, even for commercial purposes,
* all without asking permission.
*
* @Author: Andrei N. CIOBANU
*/
use synx_warm_up;
CREATE TABLE regions (