Skip to content

Instantly share code, notes, and snippets.

View manthanabc's full-sized avatar
😶‍🌫️

potatoe manthanabc

😶‍🌫️
View GitHub Profile
t=document.getElementsByTagName("pre")[0].innerHTML.split('\n')
t.pop()
let ans =0;
t.forEach((e) => {
ar=e.split(' ').map((o) => parseInt(o))
ans+= ((ar.reduce((arr, a) => {
if(arr[0] == -1) { return arr }
if(Math.abs(a-arr[0]) == 0 || Math.abs(a-arr[0]) >=4) {
return [-1, 0]
}
@manthanabc
manthanabc / DAY1.js
Created December 1, 2024 17:19
AOC javascript in browser
t=document.getElementsByTagName("pre")[0].innerHTML.split('\n')
t.pop()
a=[]
b=[]
t.forEach((q) => {
let [x, _, __, z] = q.split(' ');
a.push(x)
b.push(z)
})
a = a.sort();
@manthanabc
manthanabc / superscript.c
Created November 30, 2023 21:50
Print The given number in subscript using unicode characters
#include <Windows.h>
#include <stdio.h>
int print_up(int input)
{
SetConsoleOutputCP(CP_UTF8);
int rev=0;
while(input) {
rev=rev*10+input%10;
input=input/10;
@manthanabc
manthanabc / superscript.c
Created November 30, 2023 21:50
Print The given number in subscript using unicode characters
#include <Windows.h>
#include <stdio.h>
int print_up(int input)
{
SetConsoleOutputCP(CP_UTF8);
int rev=0;
while(input) {
rev=rev*10+input%10;
input=input/10;
/*
NATO (North Atlantic Treaty Organization)'s Logo using turtle
author: Manthan Patil, 26, september 2023
*/
#include "simplecpp"
#include <math.h>
void backward(int n) {
left(180);