Skip to content

Instantly share code, notes, and snippets.

View marisnb's full-sized avatar

Mariselvam marisnb

View GitHub Profile
@marisnb
marisnb / SameTree.java
Created September 30, 2020 04:49
[ Leet Code ] [ Easy ] 100. Same Tree
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode() {}
* TreeNode(int val) { this.val = val; }
* TreeNode(int val, TreeNode left, TreeNode right) {
* this.val = val;
@marisnb
marisnb / Parentheses.java
Created November 20, 2019 06:50
Valid Parentheses
// Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
// An input string is valid if:
// Open brackets must be closed by the same type of brackets.
// Open brackets must be closed in the correct order.
// Note that an empty string is also considered valid.
// Example 1:
// Input: "()"
@marisnb
marisnb / start.bat
Created August 21, 2019 07:35
To start tomcat service on windows using start.bat file
:: TO START TOMCAT SERVICE ::
@ECHO OFF
cd \D "Your tomcat path\bin"
startup.bat
endlocal
@marisnb
marisnb / application.properties
Created July 26, 2019 11:17
Spring boot and Postgres connection properties with our own Schema and flyway schema config
spring.jpa.hibernate.ddl-auto = validate
spring.datasource.url = jdbc:postgresql://localhost:5432/db_name
spring.datasource.username = postgres
spring.datasource.password = postgres
spring.datasource.testOnBorrow = true
spring.datasource.validationQuery = SELECT 1
spring.jpa.properties.hibernate.default_schema = db_schema_name
spring.flyway.schemas = db_schema_name
class SortingArray {
public static void main (String args[]) {
String date = "01/01/2019";
int days = 10;
System.out.println("EX :- 1");
System.out.println("----------");
System.out.println(String.valueOf(Integer.parseInt(date.substring(0,2)) + days) + date.substring(2));
System.out.println("");
System.out.println("EX :- 2");
@marisnb
marisnb / package.json
Last active March 5, 2019 10:37
Package.json set up a React app with a Spring Boot Micro Service server proxy
{
"name": "example-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"mobx": "^4.1.1",
"mobx-react": "^5.0.0",
"react": "^16.3.1",
"react-app-rewire-mobx": "^1.0.8",