Skip to content

Instantly share code, notes, and snippets.

Avatar

Shyam Rajendran bourneagain

View GitHub Profile
View gist:fb7cc841112e24cce19c
public void cal(char[] str){
System.out.println(str.length);
int dp[][] = new int[str.length+1][str.length+1];
for (int i=0; i<str.length; i++){
dp[i][i] = 1;
}
int lpsLong = Integer.MIN_VALUE;
for (int c=2; c<=str.length; c++){
for (int i=0; i<=str.length-c; i++){
View gist:0cb90851106756746933
def findMax(A):
maxW=0
startValue=A[0]
count=0
for count,i in enumerate(A):
if count==0 or i==A[-1]:
startValue=i
continue
if i<startValue:
maxW=maxW+(startValue-i)
View socket_server.py
#! /usr/bin/python3
# Socket server in python using select function
import socket, select
if __name__ == "__main__":
CONNECTION_LIST = [] # list of socket clients
RECV_BUFFER = 4096 # Advisable to keep it as an exponent of 2
PORT = 5000
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
You can’t perform that action at this time.