Skip to content

Instantly share code, notes, and snippets.

View DaniloOliveira28's full-sized avatar
😁

Danilo Oliveira DaniloOliveira28

😁
View GitHub Profile
def maxProfit(prices):
if len(prices) < 2:
return 0
s0 = dict()
s1 = dict()
s2 = dict()
s0[0] = 0
s1[0] = -prices[0]
s2[0] = 0
def n_lower_chars(string):
return sum(1 for c in string if c.islower())
def n_lower_chars_position(string):
return list((x, string[x] + "->" + string[x].upper())
for x in range(0, len(string)) if string[x].islower())
def format_word(word):
def n_lower_chars(string):
return sum(1 for c in string if c.islower())
def format_word(word):
if word == word.upper() or word == word.lower():
return 0
M = dict()
M[0] = 0
def is_palindrome(palavra):
return palavra[::-1] == palavra
def palindrome(texto):
if len(texto) <= 1:
return 0, ["None"]
res_pal = is_palindrome(texto)
if res_pal is True:
return 0, ["None"]
def is_palindrome(palavra):
return palavra[::-1] == palavra
def palindrome(texto):
if len(texto) <= 1:
return 0
res_pal = is_palindrome(texto)
if res_pal is True:
return 0
0 1 5
0 4 2
0 5 1
0 6 1
0 7 1
0 9 1
0 10 1
0 13 2
0 14 1
0 16 3
angular.module('starter.services', [])
.factory('Chats', function() {
// Might use a resource here that returns a JSON array
// Some fake testing data
var chats = [{
id: 0,
name: 'Ben Sparrow',
lastText: 'You on your way?',
angular.module('starter.controllers', [])
.controller('DashCtrl', function($scope) {})
.controller('ChatsCtrl', function($scope, Chats) {
$scope.chats = Chats.all();
$scope.remove = function(chat) {
Chats.remove(chat);
}
})
// Ionic Starter App
// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
// 'starter.services' is found in services.js
// 'starter.controllers' is found in controllers.js
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services'])
.run(function($ionicPlatform, PushNotification) {
E/chromium(26821): [ERROR:unix_domain_client_socket_posix.cc(101)] Not implemented reached in virtual int net::UnixDomainClientSocket::GetPeerAddress(net::IPEndPoint*) const
E/chromium(26821): [ERROR:unix_domain_client_socket_posix.cc(101)] Not implemented reached in virtual int net::UnixDomainClientSocket::GetPeerAddress(net::IPEndPoint*) const
I/ThermalEngine( 353): Sensor:chg_therm:32000 mC
E/chromium(26821): [ERROR:unix_domain_client_socket_posix.cc(101)] Not implemented reached in virtual int net::UnixDomainClientSocket::GetPeerAddress(net::IPEndPoint*) const
E/chromium(26821): [ERROR:unix_domain_client_socket_posix.cc(101)] Not implemented reached in virtual int net::UnixDomainClientSocket::GetPeerAddress(net::IPEndPoint*) const
I/SBar.MotoNetworkCtrlr( 1377): onReceive: WifiManager.RSSI_CHANGED_ACTION Received
I/SBar.MotoNetworkCtrlr( 1377): refreshSignalCluster[0]: wifi: mWifiConnected=true Wifi=0x7f020130=stat_sys_wifi_signal_3_fully Activity=0x00000000=( none ) Accessibility="Wi-Fi three bars."
E/c