Skip to content

Instantly share code, notes, and snippets.

View jesuscmadrigal's full-sized avatar

jesuscmadrigal

View GitHub Profile
# -*- coding: utf-8 -*-
"""FinalCode_RL_chess.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/116XsQ7P0d22cQlLEwtmNMaIu3h_jCmlT
**Installing libraries**
"""
# -*- coding: utf-8 -*-
"""Copia de Classification_task.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1ZxjAzE5xRPqsynDGTDEUeAIXgKnIiy9d
"""
import pandas as pd
# -*- coding: utf-8 -*-
"""FinalCVproject.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1Mo2qGnXDtZ44uIoGC_eGSod8NMTxBqr5
"""
!pip install caer
#Add two numbers
class Solution:
def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
dummy = ListNode()
tail, carry = dummy, 0
while l1 or l2 or carry != 0:
num1 = l1.val if l1 else 0
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
left, maxSub, seen = 0, 0, set()
for right in range(len(s)):
while s[right] in seen:
seen.remove(s[left])
left += 1
seen.add(s[right])
maxSub = max(maxSub, (right - left) + 1)
return maxSub
class Solution:
def longestPalindrome(self, s: str) -> str:
result, resultLen = "",0
for i in range(len(s)):
result, resultLen = computePalindrome(i,i, s, result, resultLen)
result, resultLen = computePalindrome(i,i+1, s, result, resultLen)
return result
def computePalindrome(left, right, string, result, resultLen):
//Main
package com.example.jesus.synaptech;
import android.content.Intent;
import android.widget.Button;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.support.design.widget.FloatingActionButton;
import android.view.View;
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
#include "BigIntegerLibrary.hh"
bool is_palindrome(BigInteger n){
string str1= bigIntegerToString(n);
string str2=str1;
#include <iostream>
#include <stdlib.h>
#include <ctime>
#include <stdio.h>
#include <cmath>
#include <string>
using std::cout;
using std::endl;
using std::cin;
using std::string;
#include <iostream>
#include<math.h>
using namespace std;
double factorial (int x)
{
double factorial=1;
for(int i=1.; i<x; i++)
{
factorial=factorial*i;