Skip to content

Instantly share code, notes, and snippets.

View axayjha's full-sized avatar
🚀
work hard, play hard

Akshay Anand axayjha

🚀
work hard, play hard
View GitHub Profile
from collections import *
class Graph:
def __init__(self):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
def add_node(self, value):
self.nodes.add(value)
#include <stdio.h>
#include <stdlib.h>
#define LEFT -1
#define RIGHT 1
int main()
{
int leftflag=1, rightflag=1, sum=0;
int n;
scanf("%d", &n);
int a[n];
#include <stdio.h>
#include <string.h>
int main()
{
char ps[101];
char c;
char s[11];
scanf("%[^\n]s", ps);
scanf(" %c", &c);
scanf(" %s", s);
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication2;
import static javaapplication2.complex.add;
/**
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
//import java.awt.Button; //not needed
/*<Applet code = "buttonapplet.class" height="500" width="500"></Applet>*/
public class buttonapplet extends Applet implements ActionListener{
TextField tf = new TextField();
Button b1 = new Button("OK");
Button b2 = new Button();
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import java.awt.Graphics.*;
import java.net.URL;
import java.applet.AudioClip;
/*<Applet code = "audioapplet.class" height="500" width="500"></Applet>*/
import java.awt.event.ActionEvent;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*<Applet code="GoodMorningFrame.class" width="500" height="500"></Applet> */
public class GoodMorningFrame extends Frame
{
public GoodMorningFrame()
{
setBackground(Color.YELLOW);
lines = []
while True:
line = input()
if line:
lines.append(line)
else:
break
for i in lines[len(lines)//2:]:
print(i)
for i in lines[:len(lines)//2]:
from math import *
def squarefree(n):
for i in range(2, ceil(sqrt(n))+1):
if n % (i*i)== 0:
return False
return True
@axayjha
axayjha / run.c
Last active September 17, 2017 18:56
#include <stdio.h>
#include <string.h>
int main()
{
char str[101];
scanf("%[^\n]s", str);
int num=0, max=0, occ=1;
int l = strlen(str);
for(int i=0; i<l; i++)