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
{ | |
"CO2InGrams": 0, | |
"CO2EmissionsDescription": "0 gr", | |
"Distance": 32600, | |
"DistanceDescription": "32.6 km", | |
"Duration": 7884, | |
"DurationDescription": "131 min", | |
"CO2GramsPerKm": 0, | |
"CO2EmissionsGramsPerKmDescription": "0 gr/km", | |
"CoinsEarned": 0, |
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
using System.Text; | |
class Solution { | |
public static string Reverse( string s ) | |
{ | |
char[] charArray = s.ToCharArray(); | |
Array.Reverse( charArray ); | |
return new string( charArray ); | |
} | |
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
class Solution { | |
public string longestPalindrome(string str) { | |
if(str==null || str.Length==0) | |
return ""; | |
int maxLength = 1; | |
int start = 0; | |
int low, high; | |
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
class Solution { | |
public string longestPalindrome(string A) { | |
if (A.Length < 2) return A; | |
int right = 0, left = 0, length = A.Length, maxLen = 0, maxLeft = 0; | |
for (int start = 0; start < length && length - start > maxLen / 2;) | |
{ | |
left = start; | |
right = start; | |
while (right < length - 1 && A[right] == A[right+1]) | |
right++; |
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
[{ | |
"sourceCoordinates": [23.56, 34.45], | |
"sourceName": "Starting Point", | |
"destinationCoordinates": [23.56, 34.45], | |
"destinationName": "Ending Point", | |
"id": "4444", | |
"startingTime": 434433, | |
"endTime": 344424, | |
"durationWithUnit": "1 Hour 45 M", | |
"distanceWithUnit": "34 KM", |
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
[{ | |
"id": "333", | |
"productName": "Product Name", | |
"imageUrl": ["google.com", "google.com"], | |
"priceInCoins": "23", | |
"productDescription": "Product Description In HTMl format", | |
"howToPurchase": "How to purchase in HTML Format", | |
"productDetail": "Detail in HTML format" | |
}, { | |
"id": "333", |
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
func getPolylineRoute(from source: CLLocationCoordinate2D, to destination: CLLocationCoordinate2D){ | |
let config = URLSessionConfiguration.default | |
let session = URLSession(configuration: config) | |
let url = URL(string: "https://maps.googleapis.com/maps/api/directions/json?origin=\(source.latitude),\(source.longitude)&destination=\(destination.latitude),\(destination.longitude)&key=AIzaSyCF2gjvLce5vbOWvpmU4lEPcAposSyFjGQ")! | |
let task = session.dataTask(with: url, completionHandler: { | |
(data, response, error) in | |
if error != nil { |
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
{ | |
"numberOfDays": [{ | |
"name": "Last 7 Days", | |
"kpisList": [{ | |
"value": "10", | |
"unit": "co2/gm" | |
}, { | |
"value": "10", | |
"unit": "KM" | |
}], |
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
extension DashboardViewController: UICollectionViewDataSource { | |
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { | |
if collectionView == durationColletionView { | |
return timeCollectionViewData.count | |
} else if collectionView == kipCollectionView { | |
return 6 | |
} else { | |
return 3 | |
} |
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 java.math.BigInteger; | |
public class Solution { | |
public String reverse(String s) { | |
return new StringBuilder(s).reverse().toString(); | |
} | |
public String solveEven(String A) { | |
String firstHalf = A.substring(0,A.length()/2); | |
String pal; | |
pal = firstHalf + reverse(firstHalf); |