This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random, sys | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# This is to divide generated values by their total sum so they sum up to U | |
def bigint(num): | |
# Round off floats to 10 decimal places | |
num = float('%.10f'%(num)) | |
# Convert to a big int preserving all 10 decimal digits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" Neural Network. | |
A 2-Hidden Layers Fully Connected Neural Network (a.k.a Multilayer Perceptron) | |
implementation with TensorFlow. This example is using the MNIST database | |
of handwritten digits (http://yann.lecun.com/exdb/mnist/). | |
Links: | |
[MNIST Dataset](http://yann.lecun.com/exdb/mnist/). | |
Author: Aymeric Damien | |
Project: https://github.com/aymericdamien/TensorFlow-Examples/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://leetcode.com/problems/palindrome-number/ | |
class Solution: | |
def isPalindrome(self, x: int) -> bool: | |
x = str(x) | |
p = len(x)-1 | |
for i in range(len(x)//2): | |
if(x[i]!=x[p]): | |
return False | |
p = p - 1 | |
return True |