This file contains hidden or 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
func compress(videoPath : String, exportVideoPath : String, renderSize : CGSize, completion : (Bool) -> ()) { | |
let videoUrl = NSURL(fileURLWithPath: videoPath) | |
if (!existsFileAtUrl(videoUrl)) { | |
completion(false) | |
return | |
} | |
let videoAssetUrl = AVURLAsset(URL: videoUrl, options: nil) | |
This file contains hidden or 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
extension URL { | |
@discardableResult | |
func append(_ queryItem: String, value: String?) -> URL { | |
guard var urlComponents = URLComponents(string: absoluteString) else { return absoluteURL } | |
// create array of existing query items | |
var queryItems: [URLQueryItem] = urlComponents.queryItems ?? [] | |
This file contains hidden or 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
// C++ program to find the shortest path between | |
// a given source cell to a destination cell. | |
#include <bits/stdc++.h> | |
using namespace std; | |
#define ROW 18 | |
#define COL 20 | |
//to store matrix cell cordinates | |
struct Point | |
{ |
This file contains hidden or 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 java.util.*; | |
class Foo4{ | |
public static void main(){ | |
int mat[18][20] = | |
{ |
This file contains hidden or 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 java.util.*; | |
class Foo3{ | |
public static void main(String args[]){ | |
int[] l = {4,3,2,1}; | |
answer(l); |
This file contains hidden or 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
package com.google.challenges; | |
import java.util.*; | |
public class Answer { | |
public static int answer(int src, int dest) { | |
class cell{ | |
public int x,y,steps; | |
public boolean mask; |
This file contains hidden or 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
var x: String = "Hello World" | |
print(x) |