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
public boolean has12(int[] nums) { | |
boolean has1 = false; | |
boolean has2 = false; | |
for (int i = 0 ; i < nums.length ; ++i) { | |
if (nums[i] == 1) | |
{ | |
has1 = true ; | |
} | |
else if (has1 && nums[i] == 2) | |
{ |
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
/* | |
Very simple example using LINQ to SQL and based on the MSDN LINQ to SQL page. | |
Make sure you include System.Data.Linq and System.Data.Linq.Mappings in your usings. | |
*/ | |
// Table you want to associate with the entity | |
[Table(Name="Customer")] | |
public class Customer | |
{ | |
// Columns in the database. Should have the same name between database and class variable |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Data; | |
using System.Windows.Documents; | |
using System.Windows.Input; | |
using System.Windows.Media; |
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
#include <stdio.h> | |
int main() | |
{ | |
// Initialize to some arbitrary value so we avoid memory and comparison problems right off the bat | |
char currentChar = '\t'; | |
int symbolCount = 0; | |
int numberCount = 0; | |
int firstTime = 1; |