
Omar GamalEldeen
has successfully completed the
React Development Cross-Skilling Nanodegree program
offered by Udacity
Certificate link:
https://graduation.udacity.com/api/graduation/certificate/ELYYJJLK/download
Omar GamalEldeen
has successfully completed the
React Development Cross-Skilling Nanodegree program
offered by Udacity
Certificate link:
https://graduation.udacity.com/api/graduation/certificate/ELYYJJLK/download
جمعية تحفيظ القرآن بالرياض – مكنون
تشهد حلقات جامع الشيخ ناصر بن سعد الصفيان -رحمه الله- بأن المشارك
عمر خميس جمال الدين
قد قام بعرض القرآن الكريم كاملا أثناء مشاركته فى فرع (ثلاثون جزءا) من سورة الفاتحة إلى سورة الناس
وذلك فى يوم الهمة المقام بالجامع بتاريخ 18/11/1443 هـ
سائلين المولى عز وجل له التوفيق والسداد
جمعية تحفيظ القرآن بالرياض – مكنون
شهادة حضور
تشهد إدارة الشئون التعليمية بجميعة تحفيظ القرآن الكريم بالرياض (مكنون) بأن الطالب/ عمر خميس جمال الدين شارك فى اليوم القرآنى المقام فى جامع الراجحى يوم السبت الموافق 3/12/1443 هـ سائلين الله له مزيدا من التوفيق والنجاح
مدير إدارة الشئون التعليمية
1971. Find if Path Exists in Graph
class Solution {
public boolean validPath(int n, int[][] edges, int source, int destination) {
if(source == destination) return true;
Graph g = new Graph(n);
for(int i = 0 ; i < edges.length; i++){
g.addEdge(edges[i][0],edges[i][1]);
g.addEdge(edges[i][1],edges[i][0]);
}
boolean[] visited = new boolean[n];
Queue<Integer> q = new LinkedList<Integer>();
q.add(source);
visited[source] =true;
while(!q.isEmpty()){
int current = q.poll();
Iterator<Integer> i = g.adj[current].listIterator();
while (i.hasNext())
{
int next = i.next();
if(next == destination) return true;
if (!visited[next])
{
visited[next] = true;
q.add(next);
}
}
}
return false;
}
class Graph
{
private int V; // No. of vertices
private LinkedList<Integer> adj[]; //Adjacency Lists
// Constructor
Graph(int v)
{
V = v;
adj = new LinkedList[v];
for (int i=0; i<v; ++i)
adj[i] = new LinkedList();
}
// Function to add an edge into the graph
void addEdge(int v,int w)
{
adj[v].add(w);
}
}
}
class Solution {
public int[] shuffle(int[] nums, int n) {
int[] out = new int[nums.length];
int x =0;
int y = nums.length/2;
for(int i = 0; i < nums.length; i++){
if(i % 2 == 0){
out[i] = nums[x];
x++;
}else{
out[i] = nums[y];
y++;
}
}
return out;
}
}
122. Best Time to Buy and Sell Stock II
class Solution {
public int maxProfit(int[] prices) {
int profit = 0;
for (int i = 0; i < prices.length-1; i++){
if(prices[i+1] > prices[i]) profit+= (prices[i+1] - prices[i]);
}
return profit;
}
}
class Solution {
public int maxArea(int[] height) {
int maxArea = Integer.MIN_VALUE;
int l = 0;
int r = height.length - 1;
while(l < r){
maxArea = Integer.max(maxArea, Integer.min(height[l],height[r])*(r-l));
if(height[l] < height[r]) l++;
else r--;
}
return maxArea;
}
}
Dynamic Programming
class Solution {
public int uniquePaths(int m, int n) {
if(n ==1 && m ==1) return 1;
int[][] grid = new int[m][n];
for(int i = 1; i <m; i++){
grid[i][0] = 1;
}
for(int i = 1; i < n; i++){
grid[0][i] = 1;
}
for(int i = 1; i < m; i++){
for(int j = 1; j < n; j++){
grid[i][j] =grid[i-1][j] + grid[i][j-1];
}
}
return grid[m-1][n-1];
}
}
605. Can Place Flowers
class Solution { public boolean canPlaceFlowers(int[] flowerbed, int n) { if(flowerbed.length == 1 && flowerbed[0] == 0) n--; for(int i = 0; i < flowerbed.length; i++){ if(i ==0 && flowerbed[i] == 0 && i+1 < flowerbed.length && flowerbed[i+1] == 0){ flowerbed[i] = 1; n--; }else if( i == flowerbed.length -1 && flowerbed[i] == 0 && i-1 >= 0 && flowerbed[i-1] == 0){ flowerbed[i] = 1; n--; } else if(flowerbed[i] == 0 && i-1 >= 0 && flowerbed[i-1] == 0 && i+1 < flowerbed.length && flowerbed[i+1] == 0){ flowerbed[i] = 1; n--; } } if(n <= 0) return true; else return false; } }