Skip to content

Instantly share code, notes, and snippets.

View Harshit850's full-sized avatar
🎯
I may be slow to respond.

Harshit Kumar Harshit850

🎯
I may be slow to respond.
View GitHub Profile
@adrianhajdin
adrianhajdin / alanStudio.js
Created August 4, 2020 09:56
Alan Studio Code Materials
intent('What does this app do?', 'What can I do here?',
reply('This is a news project.'));
const API_KEY = '7bdfb1b10aca41c6becea47611b7c35a';
let savedArticles = [];
// News by Source
intent('Give me the news from $(source* (.*))', (p) => {
let NEWS_API_URL = `https://newsapi.org/v2/top-headlines?apiKey=${API_KEY}`;
//Legendre's 3-square theorem
class Solution {
public:
int numSquares(int n) {
if(ceil(sqrt(n))==floor(sqrt(n)))
return 1;
while(n%4==0) //Remove 4^a term
n/=4;
if(n%8==7) //check if the no now is in the form of (8b + 7)
class Solution {
public:
int maximalSquare(vector<vector<char>>& matrix) {
int rows = matrix.size();
if(rows==0)
return 0;
int cols = matrix[0].size();
vector<vector<int>> dp(rows+1,vector<int>(cols+1,0));