Skip to content

Instantly share code, notes, and snippets.

View AbhiAgarwal192's full-sized avatar

Abhi Agarwal AbhiAgarwal192

View GitHub Profile
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Container</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
import { Injector, NgModule } from '@angular/core';
import { createCustomElement } from '@angular/elements';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { HelloWorldComponent } from './hello-world/hello-world.component';
@NgModule({
declarations: [
AppComponent,
@AbhiAgarwal192
AbhiAgarwal192 / hello-world.component.html
Last active April 17, 2021 09:06
hello-world component
<p>Hello World!</p>
@AbhiAgarwal192
AbhiAgarwal192 / headers.conf
Created April 12, 2021 09:25
headers.conf
add_header 'Access-Control-Allow-Origin' '*';
root: Deployment
location_include: includes/*.conf
@AbhiAgarwal192
AbhiAgarwal192 / PlusOne.cs
Created August 30, 2020 14:02
Given a non-empty array of digits representing a non-negative integer, increment one to the integer.
public class Solution {
public int[] PlusOne(int[] digits) {
int len = digits.Length;
if(len == 0){
return digits;
}
int i=len-1;
@AbhiAgarwal192
AbhiAgarwal192 / ClimbingStairs.cs
Created August 28, 2020 01:59
Ways to climb stairs.
public class Solution {
int[] dp;
public int Climb(int stepsLeft){
if(stepsLeft<0){
return 0;
}
if(stepsLeft==1){
return 1;
@AbhiAgarwal192
AbhiAgarwal192 / MergeTwoLists.cs
Created August 21, 2020 06:18
Merge two sorted linked lists and return it as a new sorted list. The new list should be made by splicing together the nodes of the first two lists.
/**
* Definition for singly-linked list.
* public class ListNode {
* public int val;
* public ListNode next;
* public ListNode(int val=0, ListNode next=null) {
* this.val = val;
* this.next = next;
* }
* }
@AbhiAgarwal192
AbhiAgarwal192 / ValidParentheses.cs
Created August 21, 2020 05:31
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
public class Solution {
public bool IsValid(string s) {
int len = s.Length;
if(len == 0){
return true;
}
var stack = new Stack<char>();
@AbhiAgarwal192
AbhiAgarwal192 / LongestCommonPrefix.cs
Created August 21, 2020 05:09
Write a function to find the longest common prefix string amongst an array of strings.
public class TrieNode{
public bool isEndOfWord;
public TrieNode[] children;
public TrieNode(){
isEndOfWord = false;
children = new TrieNode[26];
for(int i=0;i<26;i++){
children[i] = null;
}
}